package cn.edu.zafu.bigdata.YinMingyan.chapter06;

public class Divide {
    /**
     * Divides two integers and returns the result.
     * @param a the dividend
     * @param b the divisor
     * @return the division result
     * @throws ArithmeticException if the divisor is zero
     */
    public static int divide(int a, int b) throws ArithmeticException {
        if (b == 0) {
            throw new ArithmeticException("Error: Cannot divide by zero.");
        }
        return a / b;
    }
}
